package com.summer.log.center.controller;

import com.summer.common.model.AjaxResult;
import com.summer.log.center.model.Log;
import com.summer.log.center.model.LogSearchParam;
import com.summer.log.center.service.LogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.elasticsearch.core.aggregation.AggregatedPage;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/log")
public class LogController {

    @Autowired
    LogService logService;

    @RequestMapping("/search")
    public AjaxResult search(LogSearchParam param){
        AggregatedPage<Log> logs= logService.search(param);
        return new AjaxResult(true,logs);
    }
}
